<!DOCTYPE html>
<html>
<head>
    <?php include_once $_SERVER["DOCUMENT_ROOT"] . "/Public/include/resources.php"; ?>
</head>
<body class="login-page">
<div class="login-box">
    <form id="J_Form" action="/index.php/home/login/auth" method="post" enctype="multipart/form-data" class="form-horizontal">
        <div class="control-group">
            <label class="control-label">用户名：</label>
            <div class="controls">
                <input type="text" name="username" data-rules="{required:true}" /><br>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">密码：</label>
            <div class="controls">
                <input type="password" name="password" data-rules="{required:true}" /><br>
            </div>
        </div>
        <hr/>
        <div class="row">
            <div class="form-actions span13 offset3">
                <button type="submit" class="button button-primary">登录</button>
                <button type="reset" class="button">重置</button>
            </div>
        </div>
    </form>
</div>
<script>
    (function($) {
        $(function() {
            var Form = BUI.Form;
            new Form.Form({
                srcNode : '#J_Form',
                submitType : 'ajax',
                callback : function(data){
                    if (edy.ajaxHelp.handleAjax((data))) {
                        BUI.Message.Alert("登录成功");
                        location.href = "/index.php/home/index/main";
                    }
                }
            }).render();
        });
    } (jQuery));
</script>
</body>
</html>